package com.rui.study.micro.userself.controller;

import com.rui.study.commons.model.BaseController;
import com.rui.study.commons.model.Result;
import com.rui.study.micro.userself.service.AccountService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class VerifyCodeController extends BaseController {

    private static final Logger LOGGER = LoggerFactory.getLogger(VerifyCodeController.class);

    @Autowired
    private AccountService accountService;

    /**
     * 1--获取验证码
     * @param account
     * @return
     */
    @GetMapping("/v1/verify-code/{account}")
    public Result addAccount(@PathVariable String account) {
        accountService.sendVerifyCode(account);
        return new Result();
    }
}
